package cclub.demo.pojo.AO.interview;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import javax.validation.Valid;
import javax.validation.constraints.Email;
import javax.validation.constraints.Min;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.util.List;

@Data
public class interviewForm {
    private Integer id;
    @JsonProperty("user_id")
    @Min(value = 1,message = "用户ID不能为空")
    private Integer userId;
    @JsonProperty("project_id")
    private Integer projectId;
    @Size(min = 1,max = 30,message = "职位名称长度1-30")
    private String position;
    @JsonProperty("candidate_name")
    @Size(min = 1,max = 20,message = "候选人名字长度1-20")
    private String candidateName;
    @JsonProperty("candidate_mobile")
    @Pattern(regexp = "1[3|4|5|7|8][0-9]{9}",message = "候选人手机号格式不正确")
    private String candidateMobile;
    @JsonProperty("candidate_mail")
    @Email
    private String candidateMail;
    @JsonProperty("interviewer_list")
    @Valid
    private List<interviewerInfo> interviewer;
    @JsonProperty("start_time")
    private String startTime;
    @JsonProperty("is_recording_screen")
    private Integer isRecordingScreen;
    @JsonProperty("notice_info")
    @Valid
    private noticeInfo noticeInfo;

    @Data
    public static class interviewerInfo{
        @JsonProperty("interviewer_name")
        @Size(min = 1,max = 20,message = "面试官的名字长度1-20")
        private String interviewerName;
        @JsonProperty("interviewer_mobile")
        @Pattern(regexp = "1[3|4|5|7|8][0-9]{9}",message = "面试官手机号格式不正确")
        private String interviewerMobile;
        @JsonProperty("interviewer_mail")
        @Email
        private String interviewerMail;
        @Min(value = 1,message = "面试顺序不能为空")
        private Integer period;
    }

    @Data
    public static class noticeInfo{
        @JsonProperty("notice_candidate_mail")
        private Integer noticeCandidateMail;
        @JsonProperty("notice_candidate_mobile")
        private Integer noticeCandidateMobile;
        @JsonProperty("notice_interviewer_mail")
        private Integer noticeInterviewMail;
        @JsonProperty("notice_interviewer_mobile")
        private Integer noticeInterviewerMobile;
    }

}
